package com.jason.game.online.home.adapter

import android.content.Context
import android.view.View
import com.cby.library.widget.adapter.SimpleBaseAdapter
import com.cby.library.data.model.RecAdBean
import com.jason.game.online.R
import android.view.ViewGroup
import android.widget.ImageView
import com.cby.library.common.ext.load

/**
 * 描述信息
 */
class GameGridItemRecAd2Adapter : SimpleBaseAdapter<RecAdBean?> {
    constructor(context: Context?) : super(context) {}
    constructor(
        context: Context?,
        data: List<RecAdBean?>?
    ) : super(context, data) {
    }

    override fun getItemResource(): Int {
        return R.layout.item_home_ad_2
    }

    override fun getItemView(
        position: Int, convertView: View, parent: ViewGroup,
        holder: ViewHolder
    ): View {
        data[position]?.let {
            val imageView: ImageView = holder.findView(R.id.iv_recommend_icon)
            imageView.load(it.url, R.drawable.loading_bixue)
//            ImageUtils.displayDefaultRoundImage(
//                imageView, icon,
//                159, 65
//            )
        }

        return convertView
    }
}